
public class ArrayHelper {
    public static boolean equal(int[] first, int[] second) {
        if (first.length == second.length) {
            for (int i = 0; i < first.length; i++)
                if (first[i] != second[i])
                    return false;

            return true;
        }
        return false;
    }

    public static void main(String[] args) {
        int[] first = { 1, 2, 3, 4, 5 };

        int[] second = { 1, 2, 3, 4, 5 };

        int[] third = { 1, 2, 3, 4 };

        boolean result1 = equal(first, second);
        System.out.println(result1);// ture

        boolean result2 = equal(first, third);
        System.out.println(result2);//false

    }
}